package com.szcinda.service.dto.ghOrder;

import com.szcinda.service.dto.client.ClientVehiclePriceDto;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Data
public class GhOrderDto implements Serializable {
    public String id;
    public String clientId;
    public String orderNumber;
    public String clientName;
    public LocalDate pickDate;
    public String bookNumber;
    public String originPlace;
    public String destPlace;
    public int quantity;
    public double squareNumber;
    public double grossWeight;
    public double volumeWeight;
    public LocalDate actDepartureTime;
    public LocalDate receiveDate;
    public String deliveryModel;
    public String deliveryModelRemark;
    public double deliveryModelFee;
    public String carrierDeparturePort;
    public String carrierId;
    public String carrierName;
    public String userName;
    public String calculateType;
    public String currency;
    public String businessCode;
    public double pb;

    public LocalDateTime createTime;

    // 报关费 关联费用
    public double homeFee;// 主页费单价
    public double sheetFee;// 续页费单价
    public int homeCount;// 主页数
    public int sheetCount;// 续页数

    public String status;
    public String remark;
    public String billRemark; // 账单备注

    public String organizationId;
    public String organizationName;
    public String invoice;
    public String settlement;
    public String outInvoice;
    public String outSettlement;

    public String vehicleType;// 提货车型
    public String vehicleLine;// 提货线路
    public String deliveryLine;// 派送线路

    public List<FeeDto> feeList = new ArrayList<>();

    public List<FeeDto> outFeeList = new ArrayList<>();

    public List<ClientVehiclePriceDto> vehiclePrices;

    public static Map<String, String> getFieldMap() {
        Map<String, String> map = new HashMap<>();
        map.put("订单编号", "orderNumber");
        map.put("订舱号", "bookNumber");
        map.put("所属机构", "organizationName");
        map.put("客户", "clientName");
        map.put("供应商", "carrierName");
        map.put("业务类型", "businessCode");
        map.put("计费方式", "calculateType");
        map.put("提货日期", "pickDate");
        map.put("发车日期", "actDepartureTime");
        map.put("起始站", "originPlace");
        map.put("目的站", "destPlace");
        map.put("数量", "quantity");
        map.put("方数(m³)", "squareNumber");
        map.put("毛重(KG)", "grossWeight");
        map.put("体积重(KG)", "volumeWeight");
        map.put("重泡比", "pb");
        map.put("提货车型", "vehicleType");
        map.put("提货线路", "vehicleLine");
        map.put("派送车型", "deliveryModel");
        map.put("派送线路", "deliveryLine");
        map.put("派送备注", "deliveryModelRemark");
        map.put("派送日期", "receiveDate");
        map.put("创建人", "userName");
        map.put("创建时间", "createTime");
        map.put("订单备注", "remark");
        map.put("账单备注", "billRemark");
        return map;
    }


    @Data
    public static class FeeDto implements Serializable {
        public String id;
        public String feeName;
        public double feeCount;
        public String status;
        public String currency;
        public String carrierId;
        public boolean canSee;

        // 报关费 关联费用
        public double homeFee;// 主页费单价
        public double sheetFee;// 续页费单价
    }
}
